package com.qfmy.app.mapper.community;

import com.qfmy.model.entity.community.PostComment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.qfmy.app.mapper.community
 * @date 2025/4/17
 * @description 帖子评论
 */
@Mapper
@SuppressWarnings("all")
public interface PostCommentMapper {

    /**
     * 添加帖子评论
     * @param postId
     * @param userId
     * @param content
     */
    @Insert("insert into post_comment (post_id, user_id, content) values (#{postId}, #{userId}, #{content})")
    void addPostComment(Integer postId, Integer userId, String content);

    /**
     * 获取帖子的评论
     * @param start
     * @param size
     * @param postId
     * @return
     */
    List<PostComment> getPostComment(int start, Integer size, Integer postId);
}
